package com.xinyue.auto.reader.util;

import com.xinyue.auto.util.StringUtil;

public class TemporalUtil {
	private static final String DATE = "DATE";
	private static final String TIME = "TIME";
	private static final String TIMESTAMP = "TIMESTAMP";
	
	public static boolean validate(String type) throws Exception {
		if(StringUtil.isNull(type)) {
			return false;
		}
		
		if(DATE.equals(type)) {
			return true;
		}else if(TIME.equals(type)) {
			return true;
		}else if(TIMESTAMP.equals(type)) {
			return true;
		}
		
		throw new Exception("非法的Temporal值：" + type);
	}
}
